package com.szsfm.vehiclemanagement.util;

import android.text.TextUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by zhoubigbo on 2017/11/20.
 */
public class DateUtil {

    public static String fomate(String fmt) {
        SimpleDateFormat sdf = new SimpleDateFormat(fmt);
        return sdf.format(new Date());
    }

    public static String fomate2(String fmt) {
        if (TextUtils.isEmpty(fmt)){
            return "";
        }
        if (fmt.length()==14)
            return fmt = String.format("%s %s-%s %s:%s",fmt.substring(0,4),fmt.substring(4,6),fmt.substring(6,8),fmt.substring(8,10),fmt.substring(10,12));

        return fmt;
    }

}
